<table class="detail">
    <thead>
        <tr><th colspan="2">Fiche utilisateur</th></tr>
    </thead>
    <tbody>
        <tr>
            <th>Numéro</th>
            <td id="num_user"><?php echo $sf_guard_user->getId() ?></td>
        </tr>
        <tr>
            <th>Prénom</th>
            <td id="prenom_user"><?php echo $sf_guard_user->getFirstName() ?></td>
        </tr>
        <tr>
            <th>Nom</th>
            <td id="nom_user"><?php echo $sf_guard_user->getLastName() ?></td>
        </tr>
        <tr>
            <th>Adresse Email</th>
            <td><a href="mailto:<?php echo $sf_guard_user->getEmailAddress() ?>"><?php echo $sf_guard_user->getEmailAddress() ?></a></td>
        </tr>
        <tr>
            <th>Login</th>
            <td><?php echo $sf_guard_user->getUsername() ?></td>
        </tr>
        <tr>
            <td colspan="2">
                <?php if($module == 'user') : ?>
                    <a href="<?php echo url_for('user/edit?id='.$sf_guard_user->getId()) ?>" class="submit">Editer cette fiche</a>
                <?php elseif($module == 'infosUser') : ?>
                    <a href="<?php echo url_for('infosUser/edit') ?>" class="submit">Editer ma fiche utilisateur</a>
                <?php endif; ?>
            </td>
        </tr>
    </tbody>
</table>


<table class="detail">
    <thead>
        <tr><th colspan="2">Fiche activité</th></tr>
    </thead>
    <tbody>
        <tr>
            <th>Date dernière connexion</th>
            <td><?php if($sf_guard_user->getLastLogin()) echo $sf_guard_user->getDateTimeObject('last_login')->format('d/m/Y H:i:s') ?></td>
        </tr>
        <tr>
            <th>Date création</th>
            <td><?php if($sf_guard_user->getCreatedAt()) echo $sf_guard_user->getDateTimeObject('created_at')->format('d/m/Y H:i:s') ?></td>
        </tr>
        <tr>
            <th>Date dernière modification</th>
            <td><?php if($sf_guard_user->getUpdatedAt()) echo $sf_guard_user->getDateTimeObject('updated_at')->format('d/m/Y H:i:s') ?></td>
        </tr>
        <tr>
            <th>Nombre de lots enregistrés</th>
            <td><?php echo $user->getLot()->count() ?></td>
        </tr>
        <tr>
            <th>Nombre de commentaires rédigés</th>
            <td><?php echo $user->getCommentaire()->count() ?></td>
        </tr>
    </tbody>
</table>


<table class="detail">
    <thead>
        <tr><th colspan="2">Fiche compte</th></tr>
    </thead>
    <tbody>
        <?php if($module == 'infosUser') : ?>  
        <tr>
            <th>Compte actif</th>
            <td><?php if($sf_guard_user->getIsActive()) echo "Oui"; else echo "Non"; ?></td>
        </tr>
        <tr>
            <th>Rang</th>
            <td><?php if($sf_guard_user->isAdmin() == 1) echo "Administrateur"; else echo "Utilisateur"; ?></td>
        </tr>
        <?php elseif($module == 'user') : ?>
        <tr>
            <th>Compte actif</th>
            <td>
                <div class="cb-switch">
                    <label id="actif_cb-enable" class="cb-enable <?php if($sf_guard_user->getIsActive()) echo "selected" ?>"><span>Oui</span></label>
                    <label id="actif_cb-disable" class="cb-disable <?php if(!$sf_guard_user->getIsActive()) echo "selected" ?>"><span>Non</span></label>
                </div>
            </td>
        </tr>
        <tr>
            <th>Administrateur</th>
            <td>
                <div class="cb-switch">
                    <label id="admin_cb-enable" class="cb-enable <?php if($sf_guard_user->isAdmin() == 1) echo "selected" ?>"><span>Oui</span></label>
                    <label id="admin_cb-disable" class="cb-disable <?php if(!$sf_guard_user->isAdmin() == 1) echo "selected" ?>"><span>Non</span></label>
                </div>
            </td>
        </tr>
        <?php endif; ?>
    </tbody>
</table>